/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.DragonPokerClient.Thread.ClientRequest;


import org.Comunicator.Message;
import org.DragonPokerClient.Client;
import org.DragonPokerClient.graphic.Home;
import org.DragonPokerClient.graphic.Login;

/**
 *
 * @author davide
 */
public class LoginReplyRequest extends GenericClientRequest{
    private Client client;
    public LoginReplyRequest(Client c) {
        client = c;
    }


    @Override
    public void processRequest(Message message) {
        System.out.println("CLIENT-LoginReply");
        boolean reply = (Boolean)message.getParameters().get("Reply");
        if(reply == true){
            Login l = client.getLogingui();
            l.dispose();
            Home h = client.startHome();
            h.setVisible(reply);
                    Message m = new Message();
                    m.setAction("Rooms");
                    Client.sendMessage(m);
        }

        System.out.println("CLIENT: Risposta: " + reply);
    }

    @Override
    public boolean isToProcessing(Message message) {
        if("LoginReply".equals(message.getAction()) == true)
            return true;
        return false;
    }

}
